/*
 *  Cero Project - Copyright   2006 The Cero Developement Team 
 *  (Michael Laguerre, Camille Roux, Matthieu Segret, Mathieu Sivade) 
 * 
 *  This program is free software; you can redistribute it and/or modify it 
 *  under the terms of the GNU General Public License as published by the Free 
 *  Software Foundation; either version 2 of the License, or (at your option) 
 *  any later version.
 * 
 *  This program is distributed in the hope that it will be useful, but 
 *  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
 *  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 
 *  for more details.
 */

package org.ceroproject.ui;

import java.util.Collection;

import org.ceroproject.UnsupportedPluginException;
import org.ceroproject.games.GameListener;


/**
 * To declare a class or an interface as a User Interface
 * 
 * @author Camille Roux
 */
public interface UserInterface extends GameListener {
	/**
	 * Returns whether the interface is activated or not
	 * 
	 * @return whether the interface is activated or not
	 */
	boolean isActivated();

	/**
	 * Sets whether the interface should be activated or not
	 * 
	 * @param state
	 *            the new state of the interface
	 */
	void setActivated(boolean state);

	/**
	 * Adds a module to this interface
	 * 
	 * @param module
	 *            the module to add
	 * @throws UnsupportedModuleException
	 *             if this module is not supported by this interface
	 */
	void addInterfaceModule(InterfaceModule module)
			throws UnsupportedPluginException;

	/**
	 * Removes a module from the interface
	 * 
	 * @param module
	 *            the module to remove
	 */
	void removeInterfaceModule(InterfaceModule module);

	/**
	 * Returns the modules loaded by this interface
	 * 
	 * @return the modules loaded by this interface
	 */
	Collection<InterfaceModule> getInterfaceModules();

	/**
	 * Activates the module (basically, shows it and/or turns it on)
	 * 
	 * @param module
	 *            the module to activate
	 */
	void activateInterfaceModule(InterfaceModule module);

	/**
	 * Desactivates the module : basically, it hides it if it's a graphical one.
	 * Anyway, it turns it off.
	 * 
	 * @param module
	 *            the module to desactivate
	 */
	void desactivateInterfaceModule(InterfaceModule module);

	/**
	 * Returns a ChoiceMaker corresponding to this interface
	 * 
	 * @return an instance of ChoiceMaker
	 * @throws UnsupportedOperationException
	 *             if this interface does not provide user interaction
	 */
	ChoiceMaker getChoiceMaker() throws UnsupportedOperationException;

	/**
	 * Returns the name of this user interface
	 * 
	 * @return the name of this user interface
	 */
	String getUserInterfaceName();
}
